home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat3 / f90 / spread.z / spread
Encoding:
Text File  |  2002-10-03  |  3.6 KB  |  93 lines

  1. SPREAD(3I)                                            Last changed: 4-13-99
  2.  
  3.  
  4. NNAAMMEE
  5.      SSPPRREEAADD - Constructs an array from several copies of an argument
  6.  
  7. SSYYNNOOPPSSIISS
  8.      SSPPRREEAADD (([SSOOUURRCCEE==]_s_o_u_r_c_e,, [DDIIMM==]_d_i_m,, [NNCCOOPPIIEESS==]_n_c_o_p_i_e_s))
  9.  
  10. IIMMPPLLEEMMEENNTTAATTIIOONN
  11.      UNICOS, UNICOS/mk, IRIX systems
  12.  
  13.      CF90, MIPSpro 7 Fortran 90
  14.  
  15. SSTTAANNDDAARRDDSS
  16.      Fortran
  17.  
  18. DDEESSCCRRIIPPTTIIOONN
  19.      The SSPPRREEAADD intrinsic function constructs an array from several copies
  20.      of an argument.  This intrinsic function can be used for array
  21.      construction.  It replicates an array by adding a dimension.  It
  22.      broadcasts several copies of _s_o_u_r_c_e along a specified dimension and
  23.      thus forms an array of rank one greater.  SSPPRREEAADD accepts the following
  24.      arguments:
  25.  
  26.      _s_o_u_r_c_e    May be of any type.  It may be scalar or array valued.  The
  27.                rank of _s_o_u_r_c_e must be less than 7.
  28.  
  29.      _d_i_m       Must be scalar and an integer with value in the range of
  30.                1 <= _d_i_m <= _n + 1, where _n is the rank of _s_o_u_r_c_e.
  31.  
  32.      _n_c_o_p_i_e_s   Must be scalar and an integer.
  33.  
  34.      SSPPRREEAADD is a transformational intrinsic function.  The name of this
  35.      intrinsic cannot be passed as an argument.
  36.  
  37. RREETTUURRNN VVAALLUUEESS
  38.      The result is an array of the same type as _s_o_u_r_c_e and of rank _n+1,
  39.      where _n is the rank of _s_o_u_r_c_e.
  40.  
  41.      If _s_o_u_r_c_e is scalar, the shape of the result is MMAAXX((_n_c_o_p_i_e_s,,00)).  If
  42.      _s_o_u_r_c_e is array valued with shape
  43.      (_d , _d , ..., _d ),
  44.        1   2        _n
  45.      the shape of the result is
  46.      (_d , _d , ..., _d     , MMAAXX(_n_c_o_p_i_e_s, 0), _d   , ..., _d ).
  47.        1   2        _d_i_m-1                    _d_i_m        _n
  48.  
  49.      If _s_o_u_r_c_e is scalar, each element of the result has a value equal to
  50.      _s_o_u_r_c_e.
  51.  
  52.      If _s_o_u_r_c_e is array valued, the element of the result with subscripts
  53.      (_r , _r , ..., _r   )
  54.        1   2        _n+1
  55.      has the value
  56.      _s_o_u_r_c_e(_r , _r , ..., _r     , _r     , ..., _r   )).
  57.              1   2        _d_i_m-1   _d_i_m+1        _n+1
  58.  
  59. EEXXAAMMPPLLEESS
  60.      Example 1:  Assume that IISSCCAALLRR is the scalar value of 8.  The
  61.      following statements are then true:
  62.  
  63.      * The value of SSPPRREEAADD(( IISSCCAALLRR,, DDIIMM == 11,, NNCCOOPPIIEESS == 00)) is a zero-sized
  64.        array.
  65.  
  66.      * The value of SSPPRREEAADD(( IISSCCAALLRR,, DDIIMM == 11,, NNCCOOPPIIEESS == 22)) is ((//88,, 88//)).
  67.  
  68.      Example 2:  Assume that AA is the array [2, 3, 4].  The following
  69.      statements are then true:
  70.  
  71.      * The value of SSPPRREEAADD(( AA,, DDIIMM == 11,, NNCCOOPPIIEESS == 00 )) is a zero-sized
  72.        array.
  73.  
  74.      * The value of SSPPRREEAADD(( AA,, DDIIMM == 11,, NNCCOOPPIIEESS == 33 )) is as follows:
  75.  
  76.      | 2 3 4 |
  77.  
  78.      | 2 3 4 |
  79.  
  80.      | 2 3 4 |
  81.  
  82.      * The value of SSPPRREEAADD(( AA,, DDIIMM == 22,, NNCCOOPPIIEESS == 33 )) is as follows:
  83.  
  84.      | 2 2 2 |
  85.  
  86.      | 3 3 3 |
  87.  
  88.      | 4 4 4 |
  89.  
  90. SSEEEE AALLSSOO
  91.      _I_n_t_r_i_n_s_i_c _P_r_o_c_e_d_u_r_e_s _R_e_f_e_r_e_n_c_e _M_a_n_u_a_l for the printed version of this
  92.      man page.
  93.